<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link href="<?=base_url("templates/default")?>/css/index.css" rel="stylesheet" type="text/css" />
		<!--[if lt IE 9]-->
		<script src="<?=base_url("templates/default")?>/js/html5.js"></script>
		<!--[endif]-->
		<title></title>
	</head>

	<body>
		<?php $this->load->view('header');?>
		<div class="list_content">
			<div class="news_list" style="width: 750px;float: left;">
				<span class="news_list_span">首页&nbsp;><a><?=$title;?></a></span>
				<img src="<?=base_url("templates/default")?>/img/icon11.jpg" style="margin-bottom: 10px;" />
				<div class="news_list_content clr">
					<ul>
						<?php
							$tmpCode="";
							if(sizeof($currentList)!=0){
							foreach($currentList as $key=>$value){
								$tmpCode.='<li><img src="'.base_url("templates/default").'/img/icon2.jpg" />
							<a href="'.base_url("content?").'id='.$currentList[$key]["id"].'&category='.$currentList[$key]["category_name"].'">'.$currentList[$key]["title"].'</a><span>'.date("Y-m-d",$currentList[$key]["create_time"]).'</span></li>';						
								}
								echo $tmpCode;
							}
						?>
						
					</ul>
				</div>
				<div class="link_bar">
					<span style="background-color: #FFF;padding: 7px 10px;margin: 0px 5px;font-size: 15px;">共<?=$pageArr['pageMaxSize']?>条</span>
					<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']-1))?>">《上一页</a>
				<?php if($pageArr['pages']>=7){?>
					<?php
						if(($pageArr['page']!=1)&&($pageArr['page']!=2)&&($pageArr['page']!=3)){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page=1')?>">1</a>
					<?php
					}
					?>
					
					<?php
						if($pageArr['page']>=5){
					?>
						<a>...</a>
					<?php
					}
					?>
					<?php
						if($pageArr['page']-2>=1){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']-2))?>"><?=$pageArr['page']-2?></a>
					<?php
					}
					?>
					<?php
						if($pageArr['page']-1>=1){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']-1))?>"><?=$pageArr['page']-1?></a>
					<?php
					}
					?>
					<a style="background: none;" href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']))?>"><?=$pageArr['page']?></a>
					
					<?php
						if($pageArr['page']+1<=$pageArr['pages']){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']+1))?>"><?=$pageArr['page']+1?></a>
					<?php
					}
					?>
					<?php
						if($pageArr['page']+2<=$pageArr['pages']){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']+2))?>"><?=$pageArr['page']+2?></a>
					<?php
					}
					?>
					<?php
						if($pageArr['page']==1){
						?>
						<a href="<?=base_url('category/?id='.$id.'&page=4')?>">4</a>
						<a href="<?=base_url('category/?id='.$id.'&page=5')?>">5</a>
						
					<?php
					}else if($pageArr['page']==2){
						?>
						<a href="<?=base_url('category/?id='.$id.'&page=5')?>">5</a>
						<?php
						}	
						?>
					<?php
						if($pageArr['pages']-$pageArr['page']>=4){
					?>
						<a>...</a>
					<?php
					}
					?>
					<?php
						if(($pageArr['page']!=$pageArr['pages'])&&($pageArr['page']+1!=$pageArr['pages'])&&($pageArr['page']+2!=$pageArr['pages'])){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['pages']))?>"><?=$pageArr['pages']?></a>
					<?php
					}
					?>
					<?php
					}else{
						?>
						
						
					<?php
						if($pageArr['page']-2>=1){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']-2))?>"><?=$pageArr['page']-2?></a>
					<?php
					}
					?>
					<?php
						if($pageArr['page']-1>=1){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']-1))?>"><?=$pageArr['page']-1?></a>
					<?php
					}
					?>
					<a style="background: none;" href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']))?>"><?=$pageArr['page']?></a>
					
					<?php
						if($pageArr['page']+1<=$pageArr['pages']){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']+1))?>"><?=$pageArr['page']+1?></a>
					<?php
					}
					?>
					<?php
						if($pageArr['page']+2<=$pageArr['pages']){
					?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']+2))?>"><?=$pageArr['page']+2?></a>
					<?php
					}
					?>
					<?php
					}
						?>
			
						
						
					<?php
						if(($pageArr['page']!=$pageArr['pages'])&&$pageArr['pages']!=0){
						?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['page']+1))?>">下一页》</a>
					<?php
					}else{
						
						?>
						<a href="<?=base_url('category/?id='.$id.'&page='.($pageArr['pages']))?>">下一页》</a>
						<?php
						}
							?>
				</div>
			</div>

			<aside class="aside" style="width: 250px;height: 800px;float: right;">
				<p>&nbsp;</p>
				<p>&nbsp;</p>
				<h1>快速导航</h1>
				<ul class="aside_nav">
					<li>
						<a href="<?=base_url("category/?id=10")?>"><img src="<?=base_url("templates/default")?>/img/icon3.jpg" />中心简介</a>
					</li>
					<hr />
					<li>
						<a href="<?=base_url("category/?id=12")?>"><img src="<?=base_url("templates/default")?>/img/icon3.jpg" />中心要闻</a>
					</li>
					<hr />
					<li>
						<a href="<?=base_url("category/?id=13")?>"><img src="<?=base_url("templates/default")?>/img/icon3.jpg" />行业动态</a>
					</li>
					<hr />
					<li>
						<a href="#"><img src="<?=base_url("templates/default")?>/img/icon3.jpg" />科研成果</a>
					</li>
					<hr />
					<li>
						<a href="<?=base_url("category/?id=24")?>"><img src="<?=base_url("templates/default")?>/img/icon3.jpg" />科普文章</a>
					</li>
				</ul>
				<div class="list_tongzhigonggao">
					<h2>通知公告</h2>
					<?php
						if(sizeof($tongzhi)!=0){
						?>
					<p>
						<a href="<?=base_url("content?id=".$tongzhi[0]["id"]."&category=".$tongzhi[0]["category_name"])?>"><?=mb_substr($tongzhi[0]["title"],0,30,'utf-8')?></a>
					</p>
					<p><span><?=date("Y-m-d",$tongzhi[0]["create_time"])?></span></p>
					<p><?=mb_substr($tongzhi[0]["content"],0,50,'utf-8')?></p>
					<?php
					}else{
						?>
					<p>
						<a href="#">"暂无通知"</a>
					</p>
					<p><span></span></p>
					<p></p>
						
					<?php
					}
						?>
				</div>

				<h2>中心新闻</h2>
				<div class="list_center_news">
					<?php
						$tmpCode="";
						if(!empty($center_new[0]["focus"])){
							$tmpCode.='<img id="list_center_news_focus" src="'.base_url("attachments").$center_new[0]["focus"].'" />';
						}
						echo $tmpCode;
					?>
					
					<p>
						<?php
							if(sizeof($center_new)!=0){
							?>
							<a href="<?=base_url("content?id=".$center_new[0]["id"]."&category=".$center_new[0]["category_name"])?>"><?=(mb_substr($center_new[0]["content"],0,12,'utf-8')."...")?></a>
							<?php
							}else{
								?>
								<a>暂无新闻</a>
							<?php
							}
								?>
					</p>
				</div>
			</aside>
			<div class="clear"></div>
		</div>
		<?php $this->load->view('footer');?>
	</body>
</html>